package com.sunxu.bean;


import com.sunxu.ioc.domain.User;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;

/**
 * @author 孙许
 * @version 1.0
 * @date 2020/4/13 5:13 上午
 */
public class BeanDefinitionCreationDemo {
    public static void main(String[] args) {
        BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder.genericBeanDefinition(User.class);
        beanDefinitionBuilder.addPropertyValue("id", 1);
        beanDefinitionBuilder.addPropertyValue("name", "孙许");
        // 获取bean对象
        AbstractBeanDefinition beanDefinition = beanDefinitionBuilder.getBeanDefinition();
        // BeanDefinition 并非Bean终态，可以自定义修改
        
    }
}
